Ext.define("Oa.view.supplier.EditPanel",{
    extend:'Ext.form.Panel',
    alias:'widget.supplieredit',
    width:"100%",
    height:500,
    title:'信息编辑',
    autoScroll:true,
    fieldDefaults: {
            labelAlign: 'right',
            labelWidth: 100,
            msgTarget: 'under'
    },
    defaultType: 'textfield',
    defaults:{
        margin:"10 0 0 5",
        width:250,
        disabled:true
    },
    items:[{
            name:'id',
            disabled:false,
            hidden:true,
            id:'supplierid'
        },{
            itemId:'Edit0',
            name:'name',
            fieldLabel:'供方名称',
            allowBlank: false,
            blankText:'必须填写供方名称！',
            emptyText: '例如：XXX有限责任公司'
        },{
            itemId:'Edit1',
            name:'goodsName',
            fieldLabel:'供应物品名',
            allowBlank: false,
            blankText:'必须填写供应物品名!'
        },{
            itemId:'Edit2',
            name:'type',
            fieldLabel:'供应物品类型',
            blankText:'必须填写供应物品类型',
            allowBlank: false
        },{
            itemId:'Edit3',
            name:'price',
            fieldLabel:'供应物品价格',
            blankText:'必须填写供应物品价格',
            allowBlank: false
        },{
            itemId:'Edit4',
            name:'address',
            fieldLabel:'供应商地址',
            blankText:'必须填写供应商地址',
            allowBlank: false
        },{
            itemId:'Edit5',
            name:'contact',
            fieldLabel:'供应商联系人'
        },{
            itemId:'Edit6',
            name:'phone',
            fieldLabel:'供应商联系电话',
             regex: /^(13[0-9]|15[0|3|6|8|9]|18[0|5|6|8|9])\d{8}$/,
             regexText: "不能识别的<font color = red>移动电话</font>",
             blankText:'供应商联系电话！',
             allowBlank: false,
             emptyText: '例如：13000000000'
        },{
            itemId:'Edit7',
            name:'fax',
            fieldLabel:'客户传真(固话)',
            regex: /^0(\d{2}|\d{3})\-(\d{7}|\d{8})$/,
            regexText: "不能识别的<font color = red>传真/固话</font>",
            allowBlank: true,
            emptyText: '例如：000-0000000'
        },{
            itemId:'Edit8',
            name:'postcode',
            fieldLabel:'供应商邮编',
            regex:/^\d{6}/,
            regexText: "不能识别的邮编！"
        }],
    buttons:[{
            text:'新增',
            action:'add',
            id:'add'
        },{
            text:'删除',
            action:'del',
            disabled:true,
            id:'del'
        },{
            text:'修改',
            action:'update',
            id:'update',
            disabled:true
        }]
})